package cn.zjyj.module.zjyj.dal.mysql.risksample;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.risksample.RiskSampleDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.risksample.vo.*;

/**
 * 风险样本 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RiskSampleMapper extends BaseMapperX<RiskSampleDO> {

    default PageResult<RiskSampleDO> selectPage(RiskSamplePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskSampleDO>()
                .betweenIfPresent(RiskSampleDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(RiskSampleDO::getName, reqVO.getName())
                .eqIfPresent(RiskSampleDO::getRiskType, reqVO.getRiskType())
                .eqIfPresent(RiskSampleDO::getDescription, reqVO.getDescription())
                .eqIfPresent(RiskSampleDO::getRiskDetail, reqVO.getRiskDetail())
                .orderByDesc(RiskSampleDO::getId));
    }

}